/*
 *
 *      Copyright (c) 2018-2025, secureplat All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: secureplat
 *
 */

package com.iwomy.secureplat.admin.api.feign;

import com.iwomy.secureplat.admin.api.entity.SysDept;
import com.iwomy.secureplat.admin.api.vo.SysDeptVO;
import com.iwomy.secureplat.common.core.constant.ServiceNameConstants;
import com.iwomy.secureplat.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author secureplat
 * @date 2018/6/22
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteDeptService {

	/**
	 * 获取所有部门接口
	 *
	 * @return R 返回结果对象，包含所有部门信息列表
	 */
	@GetMapping("/dept/list")
	R<List<SysDept>> getAllDept();

	/**
	 * 通过部门ID获取负责人列表
	 *
	 * @param deptId 部门ID
	 * @return 负责人ID列表
	 */
	@GetMapping("/dept/leader/{deptId}")
	R<List<Long>> getAllDeptLeader(@PathVariable("deptId") Long deptId);


	@GetMapping("/dept/{id}")
	R getById(@PathVariable("id") Long id);

	/**
	 * 通过部门ID批量查询
	 *
	 * @param ids 部门ID
	 * @return 负责人ID列表
	 */
	@GetMapping("/dept/getByIds/{ids}")
	R getByIds(@PathVariable("ids") List<Long> ids);


	/**
	 * 获取所有部门接口
	 *
	 * @return R 返回结果对象，包含所有部门信息列表
	 */
	@GetMapping("/dept/getAllDeptList")
	R<List<SysDeptVO>> getAllDeptList(@RequestParam("deptName") String deptName);


	/**
	 * 查收子级列表
	 *
	 * @return 返回子级
	 */
	@GetMapping("/dept/getDescendantList/{deptId}")
	R<List<SysDept>> getDescendantList(@PathVariable("deptId") Long deptId);

	/**
	 * 查收子级列表
	 *
	 * @return 返回子级
	 */
	@GetMapping("/dept/getChildrenList")
	R<List<SysDept>> getChildrenList(@RequestParam("deptIds") Long[] deptIds);

	/**
	 * 根据部门id查找可授权的部门
	 */
	@GetMapping("/dept/authorize/{deptId}")
	R getAuthorizeById(@PathVariable("deptId") Long deptId);

	/**
	 * 查询所有部门
	 *
	 * @return
	 */
	@GetMapping("/dept/listByDeptId/{id}")
	R<List<Long>> listByDeptId(@PathVariable("id") Long id);

	/**
	 * 通过部门名查询部门id
	 */
	@GetMapping("/dept/getDeptId")
	R getDeptId(@RequestParam("deptName") String deptName);


	/**
	 * 查询所有部门
	 *
	 * @return
	 */
	@GetMapping("/dept/map")
	R<Map<Long,SysDept>> getAllMapByTenantId();

	@GetMapping("/dept/getExpenses/{id}")
	R getExpenses(@PathVariable("id") Long id);
}
